#pragma once

#include <QtCore/QtGlobal>
#include "GUIWidget/GUIWidgetBase.h"


namespace EventOper 
{
	class ParaWidgetInterfaceOperator;
}

namespace Ui 
{
	class GUIDataSolidWidget;
}

namespace Interface 
{
	class FITKCDDataSolid;
}


namespace GUI
{
	class MainWindow;
	class GUIWIDGETAPI GUIDataSolidWidget : public GUIWidgetBase
	{
		Q_OBJECT
	public:
		GUIDataSolidWidget(Interface::FITKCDDataSolid* obj, EventOper::ParaWidgetInterfaceOperator* oper, QWidget* parent = nullptr);
		~GUIDataSolidWidget();

		void init();

    private slots:
		void on_lineEdit_Name_editingFinished();
		void on_comboBox_Solid_Type_activated(int index);
		void on_comboBox_Material_activated(int index);
		void on_doubleSpinBox_Density_valueChanged(double value);
		void on_comboBox_Rigid_Type_activated(int index);
		void on_doubleSpinBox_Mass_valueChanged(double value);
		void on_checkBox_Custom_Defined_Inertia_Matrix_stateChanged(int state);
		void on_doubleSpinBox_Centroid0_valueChanged(double value);
		void on_doubleSpinBox_Centroid1_valueChanged(double value);
		void on_doubleSpinBox_Centroid2_valueChanged(double value);
		void on_doubleSpinBox_Inertia_Matrix_xx_valueChanged(double value);
		void on_doubleSpinBox_Inertia_Matrix_yy_valueChanged(double value);
		void on_doubleSpinBox_Inertia_Matrix_zz_valueChanged(double value);
		void on_doubleSpinBox_Inertia_Matrix_xy_valueChanged(double value);
		void on_doubleSpinBox_Inertia_Matrix_xz_valueChanged(double value);
		void on_doubleSpinBox_Inertia_Matrix_yz_valueChanged(double value);
		void on_doubleSpinBox_Linear_Velocity0_valueChanged(double value);
		void on_doubleSpinBox_Linear_Velocity1_valueChanged(double value);
		void on_doubleSpinBox_Linear_Velocity2_valueChanged(double value);
		void on_doubleSpinBox_Angular_Velocity0_valueChanged(double value);
		void on_doubleSpinBox_Angular_Velocity1_valueChanged(double value);
		void on_doubleSpinBox_Angular_Velocity2_valueChanged(double value);
		void on_doubleSpinBox_Initial_Euler_Angles0_valueChanged(double value);
		void on_doubleSpinBox_Initial_Euler_Angles1_valueChanged(double value);
		void on_doubleSpinBox_Initial_Euler_Angles2_valueChanged(double value);

		void on_spinBox_Type_of_Element_valueChanged(int value);
		void on_spinBox_In_or_Out_Normalvector_valueChanged(int value);
		void on_doubleSpinBox_Specified_Axis0_valueChanged(double value);
		void on_doubleSpinBox_Specified_Axis1_valueChanged(double value);
		void on_doubleSpinBox_Specified_Axis2_valueChanged(double value);
		void on_checkBox_Constrain_DOF_stateChanged(int state);
		void on_checkBox_Freeze_Movement_X_stateChanged(int state);
		void on_checkBox_Freeze_Movement_Y_stateChanged(int state);
		void on_checkBox_Freeze_Movement_Z_stateChanged(int state);
		void on_checkBox_Freeze_Rotation_X_stateChanged(int state);
		void on_checkBox_Freeze_Rotation_Y_stateChanged(int state);
		void on_checkBox_Freeze_Rotation_Z_stateChanged(int state);

    private:
		void setDataToWidget();

    private:
        EventOper::ParaWidgetInterfaceOperator* _oper = nullptr;
		Ui::GUIDataSolidWidget* _ui = nullptr;

		Interface::FITKCDDataSolid* _obj;
	};
}